<template>
<div class="container" v-title data-title="活动列表">
    <div class="contSingleList">
            <ul class="listItem">
                <li v-for="(item,index) in listdata" @click="">
                   <img src="" alt="活动详情">
                </li>
                <!-- <li class="clearfix" v-for="(item,index) in listdata">
                    <div class="left-box">
                        <p class="text1">{{item.thirdChannel==1?'支付宝':'微信充值'}}</p>
                        <p class="text2">{{item.opTime}}</p>
                    </div>
                    <div class="right-box">
                        <p>{{item.amount}}</p>
                    </div>
                </li> -->
            </ul>
    </div>
    <simplert ref="simplert"></simplert>
</div>
</template>
<script>
    import Simplert from '../../components/dialog/dialog.vue';
    export default {
        data() {
            return {
                listdata:''
            }
        },
        components: {
           Simplert
        },
        mounted: function() {
            
            let that = this;
            // 获取token
            // this.$util.getUserToken().then(token=>{
            //     that.token = token;
            // })
        this.getList();
        },
        methods: {
            open (title, message, type) {
                let obj = {
                title: title,
                message: message,
                type: type
                }
                this.$refs.simplert.openSimplert(obj)
            },
            getList() {
                const that = this;
                let more = this.$el.querySelector('.load-more')

                    that.$api.post('/activity/v1/authApi/list',{},s=>{
                        let data= s.module;
                        //     var listdata=[];
                        //    for(var i=0;i<20;i++){
                        //         listdata.push(data[0]);
                        //     }
                        //     console.log(data[0])
                        //     this.listdata = listdata;
                        this.listdata = data;
                        
                    },f=>{
                        that.open('列表获取失败',false,'','','fade_alert',function(){});
                    },{
                        'requestPlatform': that.wx_app,
                        'token': 'eyJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJzZWNhciIsImFwcGtleSI6IjE3NjAyMTE4ODY5Iiwic2VjcmV0IjoiMmJmMmQ3MDkyZGFkNTFhMzI0ZTk0YWQwN2Q2ODJkZjQifQ.Ux0IFWSJK0lOrVNUc0Yd6X41rqVS7uJXxMciPOy4rmw'
                    })
            },
            onRefresh(done) {
                this.pages = 1;
                this.getList();

                done(); // call done 

            },
            onInfinite(done) {
                this.pages++;
                this.getList();
                done();
            }

        }
    }
</script>
<style>
 html,body{
        height:100%;
    }
</style>

<style scoped>
  @import "../styles/styles.css";
    .contSingleList{
        width:100%;
        height:100%;
    }
    .listItem{
        overflow-y: auto;
        width:100%;
        margin:0;
        padding:0;
    }
    .listItem li{
        width:7.15rem;
        height:3.50rem;
        margin:0.26rem auto 0;
        border:1px solid #ededed;
    }
    .listItem li img{
        width:100%;
        height:100%;
    }

</style>
